package com.lsh.oms.core.enums;

/**
 * Project Name: lsh-payment
 *
 * @author peter
 * @date 16/10/26
 * 北京链商电子商务有限公司
 * Package
 * desc:
 */
public enum PayWay {
    /**
     *
     */
    IOS("ios",1),
    ANDROID("android",2),
    H5("h5",3),
    WINDOWS("windows",4),
    SM("sm",5),
    BSM("bsm",6),
    XCX("xcx",7);

    private String name;

    private int code;

    PayWay(String name, int code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public int getCode() {
        return code;
    }

    public static String getName(int code) {
        for (PayWay payWay : values()) {
            if (payWay.code == code) {
                return payWay.name;
            }
        }
        return null;
    }

}
